/*
 * Copyright (c) 2005-2007 jME Physics 2
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 *  * Neither the name of 'jME Physics 2' nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package ar.edu.itba.it.cg.grupo01.vehicle;

import java.util.Properties;

import ar.edu.itba.it.cg.grupo01.utils.Utils;

import com.jme.math.Vector3f;

public final class CarData {
	// You can use a model of yourself here, but remember to calibrate tha
	// CHASSIS_SCALE properly.
	public static String CHASSIS_MODEL;
	public static float CHASSIS_MASS;
	public static Vector3f CHASSIS_SCALE;

	public static float SUSPENSION_MASS;
	public static float SUSPENSION_COURSE;
	public static float SUSPENSION_STIFFNESS;
	public static float SUSPENSION_RESISTANCE;
	public static Vector3f FRONT_SUSPENSION_OFFSET;
	public static Vector3f REAR_SUSPENSION_OFFSET;

	// You can also use your own wheel model here, but remember to calibrate the
	// scale as well.
	public static String WHEEL_MODEL;
	public static float WHEEL_MASS;
	public static float WHEEL_SPEED;
	public static float WHEEL_ACCEL;
	public static float WHEEL_Z_OFFSET;
	public static float WHEEL_SCALE;

	public static void setCarData(Properties properties) {

		CHASSIS_MODEL = properties.getProperty("chassis.model");
		CHASSIS_MASS = Float.valueOf(properties.getProperty("chassis.mass"));
		CHASSIS_SCALE = Utils.getPosition(properties
				.getProperty("chassis.scale"));
		
		SUSPENSION_MASS = Float.valueOf(properties.getProperty("suspension.mass"));
		SUSPENSION_COURSE = Float.valueOf(properties.getProperty("suspension.course"));
		SUSPENSION_STIFFNESS = Float.valueOf(properties.getProperty("suspension.stiffness"));
		SUSPENSION_RESISTANCE = Float.valueOf(properties.getProperty("suspension.resistance"));
		FRONT_SUSPENSION_OFFSET = Utils.getPosition(properties
				.getProperty("suspension.front.offset"));
		REAR_SUSPENSION_OFFSET = Utils.getPosition(properties
				.getProperty("suspension.rear.offset"));
		
		WHEEL_MODEL = properties.getProperty("wheel.model");
		WHEEL_MASS = Float.valueOf(properties.getProperty("wheel.mass"));
		WHEEL_SPEED = Float.valueOf(properties.getProperty("wheel.speed"));
		WHEEL_ACCEL = Float.valueOf(properties.getProperty("wheel.accel"));
		WHEEL_Z_OFFSET = Float.valueOf(properties.getProperty("wheel.zoffset"));
		WHEEL_SCALE = Float.valueOf(properties
				.getProperty("wheel.scale"));

		

	}
}
